-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
【Hackathon 7th No.31】NO.31 为 paddle.sparse.sparse_csr_tensor进行功能增强 #68281
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
|
@luotao1 ,请问这个ci全说我未验证是怎么回事? |
@monster1015 已处理,可以重新提交一个commit |
python/paddle/sparse/creation.py
Outdated
@@ -199,13 +199,25 @@ def sparse_coo_tensor( | |||
return out | |||
|
|||
|
|||
def _infer_dense_csr_shape(crows, cols, values): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该没这么容易,3D的推导没有支持
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对的,根据我查找的资料,CSR稀疏矩阵应该是2维,我是准备给他改掉的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我检查了一下,是我搞错了,请稍等
|
|
|
那我现在是不用管他了? |
需要增加单侧来通过覆盖率测试 |
好的好的 |
已经添加了 |
PR-CI-Static-Check这个好像是需要你们那里approve的 @luotao1 |
需要approve的地方,review通过后会统一处理 |
那要求的required已经全都跑完了的 |
python/paddle/sparse/creation.py
Outdated
@@ -199,13 +199,30 @@ def sparse_coo_tensor( | |||
return out | |||
|
|||
|
|||
def _infer_dense_csr_shape(crows, cols): | |||
crows_numpy = crows.numpy() | |||
batchs = np.sum(crows_numpy[:-1] > crows_numpy[1:]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是不是应该是再加一个1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对的对的,返回那里要加的
@@ -125,6 +125,16 @@ def test_create_coo_no_shape(self): | |||
coo = paddle.sparse.sparse_coo_tensor(indices, values) | |||
assert [2, 2] == coo.shape | |||
|
|||
def test_create_csr_no_shape(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
单测多测几个case吧,测全一点,3D至少测两个
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的好的
crows = paddle.to_tensor(crows, dtype='int32') | ||
clos = paddle.to_tensor(clos, dtype='int32') | ||
values = paddle.to_tensor(values, dtype='float32') | ||
coo = paddle.sparse.sparse_csr_tensor(crows, clos, values) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
csr
crows = paddle.to_tensor(crows, dtype='int32') | ||
clos = paddle.to_tensor(clos, dtype='int32') | ||
values = paddle.to_tensor(values, dtype='float32') | ||
coo = paddle.sparse.sparse_csr_tensor(crows, clos, values) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
csr
crows = paddle.to_tensor(crows, dtype='int32') | ||
clos = paddle.to_tensor(clos, dtype='int32') | ||
values = paddle.to_tensor(values, dtype='float32') | ||
coo = paddle.sparse.sparse_csr_tensor(crows, clos, values) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
csr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已经好了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR Category
User Experience
PR Types
Improvements
Description
【Hackathon 7th No.31】NO.31 为 paddle.sparse.sparse_csr_tensor进行功能增强